@extends('layouts.application')


@section('content')

    @include('shared._sidebar')
    <!-- content start -->
    <div class="admin-content">
        <div class="admin-content-body">

            <h2 class="am-text-primary title_order">租赁订单列表</h2>
            <hr>

            <form class="am-form-inline am-u-sm-offset-0" role="form" method="get">

                <div class="am-form-group search-set">
                    <input type="text" class="am-form-field am-input-sm" name="order_no" placeholder="订单号" value="{{ Request::input('order_no') }}">
                </div>

                <div class="am-form-group search-set">
                    <input type="text" class="am-form-field am-input-sm" name="game_account" placeholder="游戏账号" value="{{ Request::input('game_account') }}">
                </div>


                <div class="am-form-group search-set">
                    <select name="order_status">
                        <option value="" @if(Request::input('order_status')=='') selected @endif>排序</option>
                        <option value="create_time" @if(Request::input('order_status')=='create_time') selected @endif>
                            按时间排序
                        </option>
                        <option value="lease_score" @if(Request::input('order_status')=='lease_score') selected @endif>
                            按人气排序
                        </option>
                    </select>
                </div>


                <div class="am-form-group search-set">
                    <button type="submit"
                            class="am-btn am-btn-secondary am-btn-sm">查 询
                    </button>
                </div>

            </form>
            <hr>

            <div class="am-g">
                <div class="am-u-sm-12">
                    <form class="am-form">
                        <table class="am-table am-table-striped am-table-hover table-main am-table-bordered">
                            <thead>
                            <tr>
                                <th>创建时间</th>
                                <th>订单号</th>
                                <th>标题</th>
                                <th>区服</th>
                                <th>买家</th>
                                <th>卖家</th>
                                <th>支付状态</th>
                                <th>租赁状态</th>
                                <th>订单金额</th>
                                <th>查看详情</th>
                            </tr>
                            </thead>
                            <tbody class="order_table">
                            @foreach($order_leases['data'] as $order_lease)
                                <tr class="{!! set_pay_class($order_lease['pay_status']) !!}">
                                    <td>{{date('Y-m-d H:i:s', $order_lease['create_time'])}}</td>
                                    <td>{{$order_lease['order_no']}}</td>
                                    <td>{{$order_lease['goods_title']}}</td>
                                    <td>{{$order_lease['game_all_name']}}</td>
                                    <td class="am-hide-sm-only">{{$order_lease['buyer_username']}}</td>
                                    <td class="am-hide-sm-only">{{$order_lease['seller_username']}}</td>
                                    <td>{!! set_pay_status($order_lease['pay_status']) !!}</td>
                                    <td>{!! set_lease_status($order_lease['lease_status']) !!}</td>
                                    <td>￥{{$order_lease['order_amount']}}</td>
                                    <td><a href="{{route('order.lease.detail', $order_lease['id'])}}">查看详情</a></td>
                                </tr>
                            @endforeach

                            </tbody>
                        </table>
                        <div class="am-cf">
                            共 {{$order_leases['total']}} 条记录
                            <div class="am-fr">
                                {!! $page !!}
                            </div>
                        </div>


                        <hr/>

                    </form>
                </div>

            </div>
        </div>

        <footer class="admin-content-footer">
            <hr>
            <p class="am-padding-left">© 2014 AllMobilize, Inc. Licensed under MIT license.</p>
        </footer>

    </div>
    <!-- content end -->
@endsection



